<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        //"i love javascript very much"
        function strFirstUpper(str) {
            let arr = str.split(" ");
            for (let i = 0; i < arr.length; i++) {
                let c = arr[i].charAt(0).toUpperCase();
                let newStr = arr[i].slice(1);
                arr[i] = c.concat(newStr);

            }
            return arr.join(" ");
        }

        console.log(strFirstUpper("i love javascript very much"));
    </script>
</body>
</html>